home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / INESWIN.ZIP / INES.DOC < prev    next >
Text File  |  1996-09-14  |  11KB  |  252 lines

  1.                          ******* InterNES *******
  2.                      The Portable NES/Famicom Emulator 
  3.                          version 0.5 (09/09/1996)
  4.                 based on the original code by Alex Krasivsky
  5.  
  6.                             by Marat Fayzullin
  7.  
  8.  
  9.                          email: fms@freeflight.com
  10.                                 IRC: RST38h
  11.                     WWW: http://www.freeflight.com/fms/
  12.  
  13.  
  14.  
  15.  
  16.                                * DICLAIMERS *
  17.  
  18. * Nintendo Entertainment System and Famicom are registered trademarks of 
  19.   Nintendo.
  20. * The author is in no way affiliated with Nintendo.
  21. * The author is in no way affiliated with any pirate group out there.
  22. * The author can not provide you with NES/Famicom games.
  23.  
  24.  
  25.  
  26.                          * NEW IN THIS VERSION *
  27.  
  28. * Finally: The infamous horizontal sync problem *fixed*. There is still
  29.   a couple of games causing problems, but the percentage of them is
  30.   very low.
  31. * Sound emulation is implemented. While not perfect, it is still better
  32.   than silence.
  33. * Windows95 version has got sound and joystick support.
  34. * iNES now handles GZIPped and PKZIPped files automatically. Just GZIP a 
  35.   file, and give its name in the command line (don't forget -gg/-sms 
  36.   switch if file has no .GG/.SMS extension).
  37. * Fixed several bugs in 6502 emulation related to the incorrect return 
  38.   address being save/restored from stack during BRK and interrupts.
  39. * Fixed initalization of the 4kB-VROM mode in the bank switch #1.
  40. * Many other bugfixes, big and small.
  41.  
  42.  
  43.  
  44.                             * INTRODUCTION *
  45.  
  46.   iNES is a portable emulator of the Nintendo Entertainment System (aka
  47. Famicom in Korea and Japan), written in C. The original code was written
  48. by Alex Krasivsky from Moscow. I added missing CPU commands, wrote screen
  49. drivers, and did some thorough hacking to make the emulator run about 85%
  50. of games. Given enough support, I hope to make it even more compatible
  51. with real NES in the future. You can always get the latest iNES binaries
  52. and support files from
  53.  
  54.                  http://www.freeflight.com/fms/iNES/
  55.  
  56.   At this moment, iNES is able to run most (80-90%) of the NES carts. Just
  57. about everything is implemented and working: ROM, VROM, screen scrolling,
  58. sprites, palette, joysticks, several different bank switches (MMCs)
  59. allowing to run large (>32kB) games. There may still be some problems with
  60. horizontal screen split synchronization and sound, as it is not completely
  61. clear how they work.  Among other things which are *not* implemented:
  62.  
  63. * Horizontal screen split (too expensive to implement).
  64. * 5th sound channel (do not know how it works).
  65. * Several MMCs, including the one used in Castlevania3 (very complicated, 
  66.   probably contains some extensions to the video controller).
  67. * Lightgun (very difficult to emulate due to some limitations of iNES code). 
  68.  
  69.   Because of its portability, iNES can be compiled on a wide variety of
  70. platforms: Unix, Amiga, Macintosh, MSDOS, Windows, etc. Nevertheless, due
  71. to the nasty experience dealing with pirate wannabes of the Net, I decided
  72. not to release the iNES source code, and not to develop freeware versions
  73. of iNES for MSDOS or Windows. The only freeware version is distributed in
  74. a binary form for various flavors of Unix. It is possible though that Alex
  75. Krasivsky will finally release his version of iNES-MSDOS, written in 80x86
  76. assembly language. It is a different program, although we are working very
  77. closely and sharing the data. 
  78.  
  79.   The Macintosh version of iNES is also available. It is being developed 
  80. by John Stiles, and it is also free.
  81.  
  82.   The Windows95 version of iNES is available from me, Marat Fayzullin, for
  83. $35US. This fee ensures that you will get free updates via email as long
  84. as iNES-Windows is being updated. For more information about it, take a
  85. look at
  86.  
  87.          http://www.freeflight.com/fms/iNES/iNESWindows.html
  88.  
  89.   I do not feel very good about maintaining a Windows version, as I do not
  90. enjoy programming under Windows, and the very first copy of iNES-Windows I
  91. sold was immediately pirated by hordes of teenage idiots worldwide. If you
  92. *do want* to see the Windows version being developed, please, register it
  93. by sending the registration fee to
  94.  
  95. Marat Fayzullin
  96. 6304 Hampton Place
  97. Elkridge, MD 21227
  98. USA
  99.  
  100.   If you have any information on NES/Famicom, or the ROM-images which can
  101. be used for testing, and are willing to help, feel free to send mail to
  102. fms@freeflight.com. Any *intelligent* help is greatly appreciated :).
  103.  
  104.  
  105.  
  106.                            * WHAT IS INCLUDED *
  107.  
  108.   Following files are included into the distribution:
  109.  
  110.   ines        - iNES executable file (ines -help for options)
  111.   neslist     - A little program to list/check .NES images (beta)
  112.   dasm        - Little 6502 disassembler
  113.   iNES.doc    - This documentation
  114.   NES.doc     - Documentation on NES programming
  115.   CART.NES    - Sample cartridge which contains a testing program for NES
  116.   CART.ASM    - The source code of a testing program
  117.   headers.tgz - Some .NES headers to be used for conversion from
  118.                 other formats to .NES
  119.   headers.zip - Same as headers.tgz, but in ZIP format
  120.  
  121.  
  122.  
  123.                              * BUTTONS *
  124.  
  125.   iNES is controlled by following buttons:
  126.  
  127.   [SPACE]    - FIRE-A button (also: [LALT],A,S,D,F,G,H,J,K,L)
  128.   [LCONTROL] - FIRE-B button (also: Z,X,C,V,B,N,M)
  129.   [TAB]      - SELECT button
  130.   [ENTER]    - START button
  131.   [BACKSPC]  - Toggle vertical/horizontal mirroring
  132.   [ESC]      - Quit emulation (also: [F12])
  133.   [SHIFT] and [CAPSLOCK] switch between joypads
  134.  
  135.   When compiled with #define SOUND:
  136.   [1]-[5]    - Turn sound channels on/off
  137.   [0]        - Turn all sound on/off
  138.   [-]        - Decrease sound volume
  139.   [+]        - Increase sound volume
  140.  
  141.   When compiled with #define DEBUG:
  142.   [F1]    - Go into the built-in debugger
  143.  
  144.  
  145.  
  146.                       * COMMAND LINE OPTIONS *
  147.  
  148.   iNES can be started with following options:
  149.  
  150.   -verbose <level>    - Select debugging messages [5]
  151.                         0 - Silent           1 - Startup messages
  152.                         2 - Illegal writes   4 - Illegal CPU ops
  153.                         8 - Bank switching
  154.   -hperiod <period>   - Number of CPU cycles per scanline [100]
  155.   -uperiod <period>   - Number of interrupts per screen update [2]
  156.   -vperiod <period>   - Number of CPU cycles per interrupt [26500]
  157.   -help               - Print this help page
  158.   -autoa/-noautoa     - Autofire/No autofire for button A [-noautoa]
  159.   -autob/-noautob     - Autofire/No autofire for button B [-noautob]
  160.   -shm/-noshm         - Use/don't use MIT SHM extensions for X [-shm]
  161.   -saver/-nosaver     - Save/don't save CPU when inactive [-saver]
  162.   -palette <number>   - Choose a color palette [0]
  163.                         0 - Normal           1 - Bright
  164.   -pal/-ntsc          - Show 240 or 224 lines [-ntsc]
  165.  
  166.   When compiled with #define DEBUG:
  167.   -trap <address>     - Trap execution when PC reaches address [FFFFh]
  168.  
  169.  
  170.  
  171.                          * CARTRIDGE FILE FORMAT *
  172.  
  173.   The iNES distribution includes a single cartridge image with a program
  174. allowing to test the emulator. There is also a source code of this program
  175. included. Following is the format of ROM-image files used by iNES (.NES
  176. extension): 
  177.  
  178. byte    contents
  179. -------------------------------------------------------------------------
  180. 0-3       String "NES^Z"
  181. 4         Number of 16kB ROM banks
  182. 5         Number of 8kB VROM banks
  183. 6         bit 0     1 for vertical mirroring, 0 for horizontal mirroring
  184.           bit 1     1 for battery-backed RAM at $6000-$7FFF
  185.           bit 2     1 for a 512-byte trainer at $7000-$71FF
  186.           bit 3     Reserved
  187.           bit 4-7   Type of ROM bank selector
  188.                      0 - None
  189.                      1 - Megaman2,Bomberman2,Destiny,etc.
  190.                      2 - Castlevania,LifeForce,etc.
  191.                      3 - QBert,PipeDream,Cybernoid,etc.
  192.                      4 - SilverSurfer,SuperContra (experimental)
  193.                      8 - F3xxx carts off FFE CDROM (experimental)
  194.                     15 - 100-in-1 cartridge (experimental)
  195. 7-15      Reserved
  196. 16-...    ROM banks, in ascending order. If a trainer is present, its
  197.           512 bytes precede the ROM bank contents.
  198. ...-EOF   VROM banks, in ascending order.
  199. -------------------------------------------------------------------------
  200.  
  201.   Note that this format will most likely expand in the next version of
  202. iNES, therefore do not take it for something permanent. The general
  203. structure will stay the same though.
  204.  
  205.  
  206.  
  207.                              * NOTES *
  208.  
  209.   You can get information about NES programming from the NES.doc file
  210. included into iNES distribution. The fresh documentation is always
  211. available at the iNES distribution site. You can also get Pascal Felber's
  212. NES copier schematics from his site at
  213.  
  214.                 http://lsesun13.epfl.ch/~felber/IO-56/
  215.  
  216.   The iNES distribution includes .NES file headers for some carts, which
  217. can be used to convert carts into .NES format. These headers are *not*
  218. guaranteed to work. If you have a cartridge ROM in CART.PRG file, and a
  219. cartridge VROM in CART.CHR file, the following has to be done to create
  220. the CART.NES file: 
  221.  
  222.   in Unix:   cat CART.HDR CART.PRG CART.CHR > CART.NES
  223.   in MSDOS:  copy/b CART.HDR+CART.PRG+CART.CHR CART.NES
  224.  
  225.   The Vertical/Horizontal Mirroring flag requires an additional
  226. explanation. In the real NES/Famicom cartridges, either A10 or A11 line of
  227. the address bus can be connected. Depending on it, video memory may either
  228. contain two screens at addresses $2000/$2400 mirrored at $2800/$2C00
  229. (Vertical Mirroring), or two screens at $2000/$2800 mirrored at
  230. $2400/$2C00 (Horizontal Mirroring). The games which only use one screen do
  231. not care about the mirroring. The games using two screens require an
  232. appropriate mirroring though. Be aware that many bank switches allow to
  233. switch mirroring from the program. 
  234.  
  235.   The 512-byte trainer mentioned before is something implemented in the
  236. Front Far East copier for the NES. When this trainer is present (its code
  237. precedes the ROM contents in the .NES file), it is loaded into
  238. $7000-$71FF, and then control is passed to it, instead of the real
  239. cartridge code. 
  240.  
  241.   The -hperiod controls how many CPU cycles it will take to refresh a
  242. single scanline of display (including HBlank). It currently defaults to
  243. 100. The -vperiod controls how many CPU cycles it takes to refresh the
  244. entire screen (including VBlank). It currently defaults to 26500, which
  245. gives us total of 265 scanlines (that is 224 or 240 real scanlines plus
  246. VBlank). The vperiod/hperiod value should never be less than 256 to give
  247. VBlank interrupt handlers enough CPU cycles. 
  248.  
  249.  
  250. ---------------
  251. Marat Fayzullin
  252.